PCOUNTER A Page Counting Print Server for Novell NetWare Networks Version 2.13 Copyright (c) 1992,1993 A.N.D. Technologies -------- OVERVIEW -------- PCOUNTER is a Novell Netware based Print Server which runs on a dedicated CPU. Its function is to not only handle print jobs and manage print queues but also to count pages on PostScript and HP LaserJet compatible printers. It can also print ASCII text input on PostScript printers. PCOUNTER is both a NetWare print server and accounting server. It subtracts the usage amount from the users' account balances and keeps a log record so that the network supervisor can track printer usage. Serial printers are supported up to 115K BAUD on RS-232 ports. PCOUNTER can work with remote printers attached to workstations and printers with network interfaces installed. The PCOUNTER console can be used to view and delete print jobs. Four additional programs are provided to facilitate PCOUNTER's usage: PCONFIG, UCONFIG, BALANCE, and DEPOSIT. HARDWARE REQUIREMENTS --------------------- PCOUNTER requires a dedicated CPU. Any old 8088 based computer will do. No hard disk is necessary. A network interface certainly helps. Page counting requires a PostScript or HP LaserJet compatible printer. 256K of free RAM after drivers are loaded should be sufficient, although that amount varies according to the number of queues serviced. PostScript printers require a serial port. SOFTWARE REQUIREMENTS --------------------- DOS 3.0 or above, NetWare 2.1 or above with accounting installed. NOTE ---- Until you register PCOUNTER, its use will be restricted to one queue, one running copy per network, and one hour running time. The complete version supports 16 queues on eight file servers and as many print servers on your network as you require, and of course, no restriction on running time. See the final page for details on how to register for the complete version. LaserJet, HPGL, and PCL are trademarks of Hewlett-Packard, Inc. PostScript is a trademark of Adobe, Inc. NetWare is a trademark of Novell, Inc. PCONSOLE, SYSCON, CAPTURE, ENDCAP, NPRINT, PRINTCON, RPRINTER, and ATOTAL are copyrighted by Novell, Inc. DOS and WINDOWS are trademarks of Microsoft, Inc. WordPerfect is a trademark of WordPerfect Corporation. ------------- UPGRADE NOTES ------------- Version 2.1: ------------ Current users of version 2.0 will need to run PCONFIG for each PCOUNTER print server, although no configuration changes need to be made. This version is much quieter in terms of network requests. In response to complaints about increased network traffic, we have decreased polling times and adjusted other culprits. Tightened up the serial port interface code for better PostScript control. Adjusted the HP LaserJet page counting scheme for the LaserJet 4, although testing was limited to WordPerfect 5.1 and Windows 3.1 drivers. Please let us know if there are any problems involving other software packages. Version 2.11+: ------------- Fixed weirdness on the Delete Print Jobs screen. Fixed errors involving queues on multiple file servers. Made changes to LaserJet page counting scheme. Added configurable currency display and pagecount total. Fixed occasional problem where certain print jobs didn't get processed until another job entered the queue. Adjusted timing of the PostScript page counting communication. Fixed Text to PostScript tab spacing. ------------------- FUTURE ENHANCEMENTS ------------------- Features which will appear in version 2.2 include PostScript pagecount support for parallel interfaces, broadcasting of error messages to printserver operators, stoppage of print jobs in the middle of HPLJ jobs when balances reach zero, and support for UNIX jobs in queues linked by the Charon gateway. If there are other features you'd like to see, let us know! Contact us at: A.N.D. Technologies P.O. Box 64811 Los Angeles, CA 90064 Compuserve - 71011,3570 Internet - 71011.3570@compuserve.com ---------------------- PCOUNTER CONFIGURATION ---------------------- PCOUNTER comes with an associated configuration program called PCONFIG. It is not necessary to use NetWare's PCONSOLE program to configure a PCOUNTER Print Server; however, you may still wish to use PCONSOLE to manage print queues and add additional properties. Unlike PCONSOLE, users may not use PCONFIG to access or view queue configurations unless they have supervisor-equivalent rights or have write access in a file server's bindery. PCOUNTER supports print service on up to eight file servers; therefore you must be a supervisor on each file server you wish to use PCOUNTER on. PCONFIG will not allow any configuration conflicts. For example: You cannot configure two queues linked to the same port to have different baud rates or different buffer sizes; You may only configure a PostScript queue for a serial port. Aside from that, PCONFIG is used intuitively. Special keys are: Ins - add a new queue Del - delete a queue F1 - more parameters F2 - set up currency formats F5 - remove a queue from service but don't delete it PgUp/PgDn - Change numerical or predefined discrete values Enter - Change any text based, user entered values Esc - Quit The configuration information for each queue is automatically stored in the file server's bindery upon exit from PCONFIG. No saving is necessary. To execute PCONFIG, type PCONFIG or PCONFIG printservername. ------------------------- THE PCOUNTER PRINT SERVER ------------------------- PCONFIG creates the print server if it doesn't already exist on the default file server and also asks if you would like to create it on all attached file servers on which you have bindery write- access. You must create the print server on all file servers where you wish queues to be serviced. PCOUNTER print servers are created with no password and have no facility for passwords, so don't try to set it or PCOUNTER won't run! You must also have installed accounting using SYSCON! The print server is set up as an accounting server in each file server's bindery, and as a queue server and queue operator for each print queue it services. Just as each user gets a mail directory with his/her own user ID number, the print server gets a home directory. However, instead of it being a subdirectory of \MAIL, it is a subdirectory of \SYSTEM. Therefore, if the print server's ID is 15000007, its home directory is \SYSTEM\15000007. The print server has read, write, and create access in this directory, and here is where it writes log files and reads header and footer files. The print server keeps a running log of all print activity in an ASCII file called PRINT.LOG. PRINT.LOG contains the same display generated on PCOUNTER's screen console. You may wish to map a permanent drive to this directory using the MAP command so you don't have to memorize the print server's ID. PCOUNTER's screen console contains three windows: "Recent Print Jobs", "Pending Print Jobs", and status lines for each connected printer. "Recent Print jobs" displays the username, banner, date, time, size, pages, cost, and account balance. This is the information which is written to \SYSTEM\"PCOUNTER_ID"\PRINT.LOG. "Pending Print Jobs" displays name and size. Pressing F1 opens a window from which anyone can view or delete a print job. Pressing F8 pauses PCOUNTER until another key is hit. *********** Ctrl-End exits PCOUNTER and logs out. ************* IMPORTANT! ---------- PCOUNTER logs in simultaneously to all file servers on which it resides where there are print queues to service. A user with accounts on different servers may have separate accounts updated. PCOUNTER updates the account ON THE FILE SERVER WHERE THE PRINT QUEUE RESIDES. ------ QUEUES ------ All queues have certain information associated with them: type, port, price, info, buffer size, header, header delay, footer, footer delay, zero flag, and serve-if-negative-balance flag. ----------- QUEUE TYPES ----------- Each queue serviced by PCOUNTER must be of a certain type, and should only contain print jobs of that type. The types supported are PostScript Only, ASCII Text to PostScript Only, PostScript and ASCII Text Conversion, HP Laserjet, and Charge Per Job. A queue is linked to a port upon which a printer is attached which can read this type of print job. PostScript queue types should be linked to a PostScript compatible printer. After each job, a CTRL-D (Hex value 04, reset) byte is sent to the printer in order to reinitialize it for the next job. PostScript page counting is supported only with a serial port connection, although we hope to support parallel ports in future versions. PCOUNTER does not attempt to analyze data placed in a PostScript queue, in order to accomodate PostScript printers such as the LaserJet 4M which can internally arbitrate incoming jobs. With these types of printers, PCOUNTER can use PostScript to count pages while the printer decides which language to use. If your PostScript printer cannot arbitrate printer languages, then your print jobs should only contain PostScript code. ASCII Text to PostScript queues only have the same qualities as PostScript queues above, except that all print jobs convert ASCII text to PostScript before being sent to the printer. Any characters extending beyond the printable right margin are wrapped around to the next line. The font used is always Courier. Print jobs which contain escape codes such as HP's PCL or dot matrix printer languages are discarded. There are attributes of a Text To PostScript job which are user configurable: point size, page orientation, bold, tab size, and margins. One may include an optional first line (which is not actually printed) in the text file to be sent with the syntax in either uppercase or lowercase: %* [Sn] [L] [B] [Tn] [MTf] [MBf] [MLf] [MRf] where n = an integer value f = an integer and/or fractional value S = point size from 3 to 100 (default=12) L = landscape orientation (default=portrait) B = Courier Bold typeface (default=Courier) T = tabsize in spaces (default=5) Mx = margin size in inches (default=0.5 inch) (Top, Bottom, Left, Right) Not all of the above options need to be specified, for example, "%* S14" would print in portrait orientation using Courier 14pt; "%* L B " would print in landscape orientation using Courier Bold 12pt; "%* MT1.5 MB1.5 would set top and bottom margins to 1.5 inches. Some programs have options for setup strings. Here a code for a carriage return is necessary, for example "%* S8\010". PostScript and ASCII Text Conversion queues combine qualities of the previous two queue types. PCOUNTER scans the print data and decides whether it is PostScript or whether to convert text to PostScript. It discards any print job which begins with an escape code (HP, Dot-Matrix Printers). A standard PostScript file identifies itself with the first line '%!' (not including quotes). However, not all software packages observe this custom, and PCOUNTER tests further to protect against such occurrences. If PCOUNTER fails to detect a PostScript file, please contact A.N.D. Technologies, and send the name of the offending software and, if you can, the first page of PostScript code. !!!!!!!! WARNING !!!!!!!! Some software will take a long time generating PostScript output; those for graphics and CAD in particular. If you are using CAPTURE to access print queues, you may need to increase the timeout value in order to avoid breaking up the print job into pieces. This can result in PostScript code being converted to text and many unnecessary pages printed. HPLaserJet queues should be linked to an HP LaserJet compatible printer. After each job, a reset sequence (ESC,E) is sent to the printer to reinitialize it for the next job. These queues are supported on all ports. Print jobs may contain up to PCL 5 or ASCII text. Graphics and soft fonts are supported. Users' accounts are charged a price per page times the number of pages printed. Charge Per Job queues may be linked to any kind of printer or port; however, pages are not counted and the print data is not analyzed or modified in any way. Users' accounts are charged a fixed price for each print job. ----- PRICE ----- This is a currency amount (default range $0.00 - $99.99) which refers either to the price per job (Charge Per Job queues) or to the price per page (all other queues). NetWare internally keeps account balances in terms of units, so the range in units is 0-9999. PCOUNTER assigns one unit equal to the currency unit of your choice. If you don't wish to charge for certain jobs, set the type to Charge Per Job and the price to zero. If PCOUNTER is only keeping print totals (see Currency), then this value is meaningless. ----- PORTS ----- The options are numerous. You may link: One queue ---> One Port One queue ---> Multiple Ports Multiple queues ---> One Port; provided no configuration conflicts occur (see above). A total of eight "ports" are supported: COM1-COM4 (serial), LPT1-LPT3 (parallel), and Another Printserver. Serial Port (RS-232) baud rates are supported up to 115K BAUD. Serial printers should be set for XON/XOFF protocol, 8 Data bits, No Parity, and 1 Stop bit. COM3 and COM4 are untested. Unfortunately, there are no standards for COM3 and COM4. Each port requires its own address and IRQ (Interrupt Request) number. The most common address for COM3 is 3E8 and for COM4 is 2E8, but different boards may use different addresses. Likewise, COM1 uses IRQ 4 and COM2 uses IRQ 3. Serial ports may not share an IRQ if you wish to use them at the same time. LPT1 uses IRQ 7. IRQ 5 is used by LPT2 on the AT and by the Hard Disk system on the PC/XT. IRQ 6 is used by the Floppy Disk system. Also, your network card may require use of an IRQ. PCOUNTER uses the following defaults: COM3 - address 3E8 - IRQ 5 COM4 - address 2E8 - IRQ 7 You may change these defaults on the command-line: PCOUNTER printservername [/C:I:A] (no acronym intended) where C=COM # I=IRQ # A=Address in Hex example: PCOUNTER PSERVER1 /3:7:220 /4:5:210 As mentioned above, PCOUNTER only supports PostScript accounting over serial ports. Some "smart" printers can arbitrate incoming jobs between its various ports and also select a printer mode based upon incoming data. If your printer cannot do this, then you should not configure a PostScript queue and an LaserJet queue to be serviced on the same port. Parallel Ports require no special configuration. Another Printserver (PS->) is included here as a "port" in order to take advantage of NetWare's remote printing capabilities and printers with built-in network interfaces. If your version of NetWare does not support this feature, then skip this section. Otherwise, here it is conceptually: 1 - Job is placed in queue with PCOUNTER as target print server 2 - PCOUNTER counts pages, charges account 3 - PCOUNTER sets NetWare print server as target 4 - NetWare print server prints job remotely In order to configure this scenario, you must have previously used PCONSOLE to configure the NetWare print server as a queue server for the current queue and set up the remote printing parameters. If you choose "PS->" as a port, all print servers which service the current queue (except the one you're currently configuring) may be chosen in the "Info" field by pressing PgUp or PgDn. Finally, to implement our scenario, you must specify the PCOUNTER server as the target print server either on the command line to CAPTURE or NPRINT or as part of a print job configuration using PRINTCON. If you fail to specify a specific target print server then the wrong print server could grab the job first. For more information on NetWare, check your manuals!! Once PCOUNTER has charged a user for a print job on a queue with the "PS->" option, it sets the target print server as the one referred to in the configuration. However, PCOUNTER does not know what happens to the print job after that; such as whether it was actually printed or not. For that reason PCOUNTER will not service a job in this way unless the other print server is also attached to the queue. ----------- BUFFER SIZE ----------- This specifies the size of the data chunks sent to the printer. The sizes range from 64 to 8K bytes. However, if the buffer size is too large and the printer's receive buffer fills up then PCOUNTER may have to wait. It is especially recommended to use small buffer sizes on slow dot matrix printers. You may need to try different values to see what works best for you. -------------------------------------- HEADER FILES, FOOTER FILES, AND DELAYS -------------------------------------- This feature serves multiple purposes. Header and footer files may contain special printer command data for setting up certain jobs, may be used for soft fonts, or may contain printer codes for emulating other printers. In the latter case, perhaps you have a PostScript printer which can also emulate an HP LaserJet or plotter. PCOUNTER can count pages in this fashion if the default mode for the printer is PostScript, the header file is a command to start the emulation, and the footer file is a command to return to PostScript mode. This is where the delay enters the picture. After you start or stop an emulation, the printer may need time to reinitialize. If more data is sent too quickly, data may be lost; or the printer could hang. Again, you may need to experiment to discover the optimum setup. PCOUNTER may not count pages correctly using the emulation technique described above on a printer whose default mode is not PostScript. For example, printers which support PCL5 (LaserJet III, IIIP, etc.) are able to have HP plotter (HPGL) commands embedded in PCL5 data. PCOUNTER can handle PCL5 data containing embedded HPGL if the queue type is HP LaserJet, no header or footer files are defined, and the job is sent. However, if you set the header and footer to be PCL5 commands and the print job is strictly HPGL, then PCOUNTER would treat the HPGL data as ASCII text and perhaps count the wrong number of pages. Header and Footer files MUST be placed in the print server's home directory. If a header or footer is specified in the configuration and is not in the home directory, PCOUNTER refuses to service the queue. EXAMPLES PostScript --> HPLJ HPLJ --> PostScript serverdict begin 0 exitserver using [ASCII] values statusdict begin 5 setsoftwareiomode end [27][16][48] Check your printer manual for emulation commands. --------- ZERO FLAG --------- This flag determines whether PCOUNTER should send a broadcast message after a print job if the user's account balance is zero or negative. ------------------------- SERVE IF NEGATIVE BALANCE ------------------------- This flag determines if PCOUNTER should print a queue job if the user's account balance is zero or negative. -------- CURRENCY -------- An effort has been made to accomodate users from outside the United States by including a configurable currency option, although messages are still in English. Here you may enter a guideline for PCOUNTER to display your money! The default value is "$1234.56". Therefore PCOUNTER will show a dollar sign followed by 4 digits to the left of the decimal point, and then 2 digits after the decimal point. Another example is "1234.56 kr". If you would rather have PCOUNTER keep a total of printed pages instead of charging money, enter "PAGES+" or "PAGES-" at the currency prompt. PCOUNTER will add to (PAGES+) or subtract from (PAGES-) the account balance one accounting unit for each printed page. Use "PAGES+" to keep a running total. Use "PAGES-" if you want to set limits on allowable prints. The Serve if Negative Balance Flag can be set to limit page countdowns. If PCOUNTER is only keeping page totals, then the Price Per Page field is meaningless. If you are currently using PCOUNTER to keep page totals by charging $0.01 per page, then here is a method to update your system. Any user who has printed will have a negative balance. At a DOS prompt type: BALANCE /ALL > UPDATE.BAT This creates the file UPDATE.BAT which contains a list which looks like this: MICK -3.67 KEITH -5.67 GEORGE -0.43 RINGO -0.15 : : Using your favorite text editor, insert a carriage return at the beginning of UPDATE.BAT. Next, from the beginning of the file, replace each "" with "DEPOSIT " (note the space after DEPOSIT). Also replace each "-" with nothing. Now if you execute UPDATE.BAT twice, each user's balance will be the negative of it's previous value. ------------ BANNER PAGES ------------ ARE NOT SUPPORTED ---- Save a tree today! ----------------------------- OPTIONS FOR STARTING PCOUNTER ----------------------------- PCOUNTER printservername [/C:I:A] (no acronym intended) where C=COM # I=IRQ # A=Address in Hex example: PCOUNTER PSERVER1 /3:7:220 /4:5:210 NOTE: printservername is required. See PORTS for explanation. For simplicity and efficiency, you may wish to place PCOUNTER.EXE on a boot disk(ette) or in the \LOGIN directory so that PCOUNTER automatically starts up at boot time. When PCOUNTER runs, the workstation is logged in automatically to all file servers specified in PCONFIG. To exit PCOUNTER type CTRL-END, and the workstation is logged out. ---------------- CONNECTION NOTES ---------------- If you're using a serial port connection then you need a null modem cable! In some instances with newer LaserJets there have been reports of non- communication when ROBUST XON/XOFF is set ON. You may need to turn it off. --------------------- NOTES FOR SUPERVISORS --------------------- When accounting is installed, NetWare creates a log file called NET$ACCT.DAT in the \SYSTEM directory. An entry is added to the file for each "accounting" occurrence, including logins, logouts, PCOUNTER transactions, and optionally connect time and disk usage. Thus it can become a huge file if left unnoticed. The NetWare program ATOTAL is used to view statistics of this file. If you don't need to check this information then feel free to delete it. The same goes for PRINT.LOG in the print server's home directory. The nature of the HP LaserJet Printer Control Language (PCL) is such that, unlike PostScript, two way communication between the computer and the printer was not supported until the LaserJet IIISi and LaserJet 4. Therefore the print data must be examined and the number of pages then calculated. Given that there are countless combinations of PCL commands which can eject a page, and that the PCL data may be itself incorrect (such as font commands when a cartridge does not exist), there is no guarantee that PCOUNTER will count correctly 100% of the time. However, for software programs configured correctly which format print data, there should generally be few problems. ------------------- ADDITIONAL PROGRAMS ------------------- ---- DEPOSIT.EXE ---- usage: DEPOSIT [[fileservername/]username] [amount] This program is restricted to supervisors only. If "fileservername/" is omitted then the deposit is made to the user's account on the default file server. ex. DEPOSIT JOHN 3 DEPOSIT FS1/MARY 7.50 If you wish to record deposits in \SYSTEM\"PCOUNTER_ID"\PRINT.LOG, then you (the supervisor) should set a DOS environment variable PCOUNT to the name of the print server in whose PRINT.LOG you want the deposits to be placed. ex. SET PCOUNT=FS1/PSERVER1 If you wish, you may place a command in your login script to set PCOUNT automatically for example: DOS SET PCOUNT="FS1/PSERVER1". If PCOUNT is not set, you will receive the message: "Deposit not recorded in PRINT.LOG". However, the deposit is still made. PCOUNT also enables DEPOSIT.EXE to look in the print server's configuration in order to display values in the currency choice you have made. Otherwise the default currency display is "$1234.56". Also provided for your convenience is DEPOSIT.PIF for use with Microsoft Windows 3.1. DEPOSIT knows when Windows is active, and it pauses for a few seconds before closing its window so that you can see the results. ---- BALANCE.EXE ---- usage: BALANCE [fileservername] [/ALL] [/CFG] Displays the user's account balance from the default or specified file server on the screen. It returns DOS Errorlevel 1 if the account balance is zero or negative. You may use this in a batch file to restrict network printer access. ex. : CAPTURE BALANCE IF ERRORLEVEL 1 ENDCAP : The /ALL option will display a list of all users and their balances on the screen. The output may be redirected to a file for recording purposes. ex. BALANCE FS1 /ALL >BALANCES.ALL will list all users and balances in the file BALANCES.ALL. ---- BALANCE.EXE, continued ---- The /CFG option will create a configuration file BALANCE.CFG in the same directory as BALANCE.EXE, but only if the PCOUNT environment variable mentioned under DEPOSIT is set. This allows all users to view their account balance in the currency mode, which you have set in PCONFIG, without having to set PCOUNT for each user. If you rename BALANCE.EXE, then you must also rename BALANCE.CFG the same way. ---- UCONFIG.EXE ---- Use UCONFIG to remove the PCOUNTER configuration on any print server which was previously defined in PCONFIG, but is now used as a standard Novell print server. Not using UCONFIG can cause a problem resulting in an incorrect number of licenses seemingly being used. ----------- INFORMATION ----------- PCOUNTER IS DISTRIBUTED AS IS, WITHOUT ANY EXPRESS OR IMPLIED WARRANTY. NO RESPONSIBILITY OR LIABILITY WILL BE ASSUMED BY A.N.D. TECHNOLOGIES FOR ANY FAILURE OF THIS SOFTWARE, OR ANY PROBLEMS OR DAMAGE ENSUING THEREBY. USAGE OF THE SOFTWARE IS CONSTRUED AS ACCEPTANCE OF THIS DISCLAIMER OF LIABILITY. Until you register PCOUNTER, its use will be restricted to one queue, one running copy per network, and one hour running time. The complete version supports 16 queues on eight file servers and as many print servers on your network as you require, and of course, no restriction on running time. PCOUNTER is shareware. You may distribute the unregistered version of PCOUNTER at no charge but please distribute it in the archived file PCNT213.ZIP - which include the files PCOUNTER.EXE, PCOUNTER.TXT, DEPOSIT.EXE, DEPOSIT.PIF, BALANCE.EXE, UCONFIG.EXE, and PCONFIG.EXE. ------------ REGISTRATION ------------ PCOUNTER costs $45 U.S. plus $20 for each additional network license. If you are registering from outside the U.S., please make sure your payment is cashable at a U.S. bank so that we are not liable for any conversion fees. Send payments to: A.N.D. Technologies P.O. Box 64811 Los Angeles, CA 90064 Please include your name, company, mailing address, E-Mail address(es), and how you learned about PCOUNTER. **************************************************************** If you intend to use more than one PCOUNTER print server on your network, please order the necessary number of licenses; PCOUNTER knows how many copies are running at any time and will exit if a licensing error is detected. **************************************************************** Please feel free to leave questions, comments, and suggestions for improvements at: Compuserve - 71011,3570 Internet - 71011.3570@compuserve.com By supporting PCOUNTER now you will be supporting future versions. After you register, your license(s) will be valid through the current version number plus one; i.e. - 2.1 through 3.1; 2.2 through 3.2, etc. PCounter - Copyright (c) 1992,3 A.N.D. Technologies ******************************************************** Also look for PSPS - the PostScript PrintScreen Utility! as PSPS11.ZIP Version 2.0 is almost ready! ********************************************************